import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const SYSTEM: AppRouteRecordRaw = {
  path: '/sys',
  name: 'sys',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: '系统管理',
    ignoreCache: true,
    requiresAuth: true,
    icon: 'icon-settings',
    order: 2,
    roles: 'sys:sys',
  },
  children: [
    {
      path: 'teacher',
      name: 'teacher',
      component: () => import('@/views/user/index.vue'),
      meta: {
        locale: '用户管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:teacher',
      },
    },
    // sys:organization
    {
      path: 'organization',
      name: 'organization',
      component: () => import('@/views/system/organization/index.vue'),
      meta: {
        locale: '班级管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:organization',
      },
    },
    // sys:student
    {
      path: 'student',
      name: 'student',
      component: () => import('@/views/user/student.vue'),
      meta: {
        locale: '学生管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:student',
      },
    },
    {
      path: 'major',
      name: 'major',
      component: () => import('@/views/system/major/index.vue'),
      meta: {
        locale: '专业管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:major',
      },
    },
    // sys:dept
    {
      path: 'dept',
      name: 'dept',
      component: () => import('@/views/system/dept/index.vue'),
      meta: {
        locale: '部门管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:dept',
      },
    },
    {
      path: 'role',
      name: 'role',
      component: () => import('@/views/system/role/index.vue'),
      meta: {
        locale: '角色管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:role',
      },
    },
    {
      path: 'permission',
      name: 'permission',
      component: () => import('@/views/system/permission/index.vue'),
      meta: {
        locale: '权限管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:permission',
      },
    },
    {
      path: 'dictType',
      name: 'dictType',
      component: () => import('@/views/system/dict/type.vue'),
      meta: {
        locale: '字典管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:dictType',
      },
    },
    // {
    // 	path: 'dictData',
    // 	name: 'dictData',
    // 	component: () =>
    // 		import('@/views/system/dict/data.vue'),
    // 	meta: {
    // 		locale: '字典管理',
    // 		ignoreCache: true,
    // 		requiresAuth: true,
    // 		roles: '*',
    // 	},
    // },
    {
      path: 'loginlogs',
      name: 'loginlogs',
      component: () => import('@/views/system/logs/login.vue'),
      meta: {
        locale: '日志管理',
        ignoreCache: true,
        requiresAuth: true,
        roles: 'sys:loginlogs',
      },
    },
    {
      path: 'operlogs',
      name: 'operlogs',
      component: () => import('@/views/system/logs/oper.vue'),
      meta: {
        locale: '操作日志',
        ignoreCache: true,
        requiresAuth: true,
        hideInMenu: true,
        roles: '*',
      },
    },
  ],
};

export default SYSTEM;
